package cn.sitcat.springbootshiro.service;

import cn.sitcat.springbootshiro.dao.UserMapper;
import cn.sitcat.springbootshiro.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author hiseico
 * @date 2019/4/17 21:40
 * @desc
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 根据用户名查询用户信息
     *
     * @param name
     * @return
     */
    @Override
    public User getUserByName(String name) {
        return userMapper.selectUserByName(name);
    }

    /**
     * 根据id查询用户信息
     *
     * @param id
     * @return
     */
    @Override
    public User selectUserById(Long id) {
        return userMapper.selectUserById(id);
    }
}
